<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" isELIgnored="false" import="java.util.*"
	pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>

<link href="<%=request.getContextPath() %>/css/um/default.css" rel="stylesheet" type="text/css" />
<link href="<%=request.getContextPath() %>/css/um/milk.css" rel="stylesheet" type="text/css" />
<link href="<%=request.getContextPath() %>/css/um/register.css" rel="stylesheet" type="text/css" />
<link href="<%=request.getContextPath() %>/fare/lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
<link href="<%=request.getContextPath() %>/fare/lib/ligerUI/skins/Gray/css/all.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/jsFile/easyui/themes/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/jsFile/easyui/themes/icon.css"/>
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/css/form_table.css"/>
<script type="text/javascript" src="<%=request.getContextPath() %>/jsFile/easyui/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/jsFile/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/jsFile/easyui/jquery.easyui.extend.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/jsFile/easyui/jQuery.Json.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/jsFile/easyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/jsFile/kindEditor/kindeditor-min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/fare/lib/ligerUI/js/ligerui.min.js"></script>
<link type="text/css" rel="stylesheet" href="<%=request.getContextPath() %>/jsFile/formvalidator/style/validator.css"></link>
<script src="<%=request.getContextPath() %>/jsFile/formvalidator/formValidator-4.0.1.js" type="text/javascript" charset="UTF-8"></script>
<script src="<%=request.getContextPath() %>/jsFile/formvalidator/formValidatorRegex.js" type="text/javascript" charset="UTF-8"></script>
<!--  
<script src="<%=request.getContextPath() %>/jsFile/formvalidator/DateTimeMask.js" type="text/javascript" charset="UTF-8"></script>
-->
<link rev="stylesheet" media="all" href="<%=request.getContextPath() %>/fare/css/form_style.css" type="text/css" rel="stylesheet">
<script  type="text/javascript">


/**
 * 表单验证
 */
 function validator(){
 $.formValidator.initConfig({formID:"signupform",debug:false,submitOnce:true,
		submitAfterAjaxPrompt : '有数据正在异步验证，请稍等...'
	});
	
	
	$("#user_password").formValidator({onShow:"",onFocus:"至少6个字符,最多12个字符",onCorrect:"密码正确"})
	.inputValidator({min:6,max:12,empty:{leftEmpty:false,rightEmpty:false,emptyError:"密码两边不能有空符号"},onError:"你输入的密码非法,请确认"})
    .ajaxValidator({
	dataType : "json",
	async : true,
	url : "/taluo-web/userAction!checkPassword.action?userInfo.id=${userInfo.id}",
	success : function(data){
		if(data) return true;
        else	return false;
	},
	buttons: $("#button"),
	error: function(jqXHR, textStatus, errorThrown){alert("服务器没有返回数据，可能服务器忙，请重试"+errorThrown);},
	onError : "密码输入错误，请重新填写",
	onWait : "正在检验密码是否正确，请稍候..."
	});

	$("#user_newpassword").formValidator({onShow:"",onFocus:"至少6个字符,最多12个字符",onCorrect:""})
	.regexValidator({regExp:"^([a-zA-z0-9]*[a-zA-z]+[a-zA-z0-9]*)+$",onError:"密码至少由一个字母组成,不能包含特殊字符"})
	.inputValidator({min:6,max:12,empty:{leftEmpty:false,rightEmpty:false,emptyError:"密码两边不能有空符号"},onError:"你输入的密码非法,请确认"});
	
	$("#user_password_confirmation").formValidator({onShow:"",onFocus:"至少6个字符,最多12个字符",onCorrect:""})
	.inputValidator({min:6,max:12,empty:{leftEmpty:false,rightEmpty:false,emptyError:"重复密码两边不能有空符号"},onError:"你输入的密码非法,请确认"})
	.compareValidator({desID:"user_newpassword",operateor:"=",onError:"2次密码不一致,请确认"});
	
	
	
}
 
 
 
$(document).ready(function(){
	validator();
	var status = "${status}";
	if(status=='success'){
		$.ligerDialog.success('设置成功!',function(){
			parent.reload();
			parent.$.ligerDialog.close(); 
		});
	}
	if(status=='error'){
		$.ligerDialog.error('设置失败!');
		
	}
});





 </script>
</head>
<body id="aboutus" >
<div id="center">
     <div  >
         <div class="register_content_center" >
             <ul id="errorlist"></ul>
               <form  action="<%=request.getContextPath() %>/userAction!updatePassword.action"  id="signupform" method="post">
               	 <input type="hidden" name="userInfo.id" value="${userInfo.id }"/>
                 <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" >
                       <tbody>
                     <tr>
                         <td align="right" valign="middle" style="width: 100px;">原密码<span class="req">*</span>&nbsp;</td>
                         <td style="width: 120px;">
                           <input class="input_205 input_txt" id="user_password" maxlength="12" minlength="6"  name="userInfo.oldpassword" size="12"  type="password">
                         </td>
                         <td><div id="user_passwordTip" style="width:240px"></div></td>
                     </tr>
                     <tr>
                         <td align="right" valign="middle">新密码<span class="req">*</span>&nbsp;</td>
                         <td>
                           <input class="input_205 input_txt" id="user_newpassword" maxlength="12" minlength="6"  name="userInfo.password" size="12"  type="password">
                         </td>
                         <td><div id="user_newpasswordTip" style="width:240px"></div></td>
                     </tr>
                     <tr>
                         <td align="right" valign="middle">确认新密码<span class="req">*</span>&nbsp;</td>
                         <td>
                             <input class="input_205 input_txt" id="user_password_confirmation" maxlength="12" minlength="6"  name="userInfo.cfpassword" size="12"  type="password">
                         </td>
                         <td><div id="user_password_confirmationTip" style="width:240px"></div></td>
                     </tr>
                     <tr >
						 <td style="text-align:center;height:35px;" colspan="3">
							<input  id="button" value="" class="btn05" type="submit" />
							<input  value="" type="reset" class="btn03"/>
						 </td>

                     </tr>
                 </tbody></table>
				</form>        
			</div>
         <div class="register_content_bottom"></div>
     </div>
 </div>
</body>
</html>